package matrices;

/**
 * Matrix Element interface for use with classes implementing Matrix interface
 * @author s0932248
 *
 */

public interface MatrixElement {
	/**
	 * Method for adding two MatrixElement objects, method should throw an IllegalArgumentException
	 * if the types are incompatible.
	 * The method should act on the MatrixElement it is called from and return
	 * a pointer to that element
	 * @param b
	 * @return
	 */
	public MatrixElement add(MatrixElement b);
	
	/**
	 * Method for subtracting two matrixElement objects
	 * @param b
	 * @return
	 */
	public MatrixElement subtract(MatrixElement b);
	
	/**Method for multiplication (if defined) of two matrixElements
	 * 
	 * @param b
	 * @return
	 */
	public MatrixElement multiply(MatrixElement b);
	
	/**Method for inverting an element, eg(1/value) for Fields
	 * 
	 * @return
	 */
	public MatrixElement invert();
	
	/**Create a new MatrixElement and return that, use when you want to copy a value and store it
	 * somewhere else
	 * 
	 * @return
	 */
	public MatrixElement createNewInstance();
	
	/**
	 * Return a new MatrixElement with a zero value
	 * @return
	 */
	public MatrixElement zeroValue();
	
	/**
	 * 
	 * @return
	 */
	public boolean isZeroValue();
	
	/**
	 * Return a new MatrixElement with a unity value
	 * @return
	 */
	public MatrixElement unityValue();
	
	/**
	 * 
	 * @return
	 */
	public boolean isUnityValue();
	
	/**
	 * Return wether the MatrixElements values are equivalent
	 * @param b
	 * @return
	 */
	public boolean isEqualTo(MatrixElement b);
	
	/**
	 * 
	 * @return
	 */
	public String toString();
	
	/**
	 * 
	 * @param b
	 * @return
	 */
	public boolean isCompatibleWith(MatrixElement b);
}
